Skip to contents

Import a stock-and-flow model from Insight Maker. Models may be your own or from another user. Importing causal loop diagrams or agent-based models is not supported.

Usage

insightmaker_to_sfm(
  URL,
  filepath_IM,
  directory = tempdir(),
  keep_nonnegative_flow = TRUE,
  keep_nonnegative_stock = FALSE,
  keep_solver = FALSE,
  debug = FALSE
)

Arguments

URL

URL to Insight Maker model. Character.

filepath_IM

File path to Insight Maker model. Only used if URL is not specified. Needs to be a character with suffix .InsightMaker.

directory

Directory to save translated Insight Maker model in (optional). Defaults to temporary directory.

keep_nonnegative_flow

If TRUE, keeps original non-negativity setting of flows. Defaults to TRUE.

keep_nonnegative_stock

If TRUE, keeps original non-negativity setting of stocks Defaults to TRUE.

keep_solver

If TRUE, keep the ODE solver as it is. If FALSE, switch to Euler integration in case of non-negative stocks to reproduce the Insight Maker data exactly. Defaults to FALSE.

debug

If TRUE, print all conversion output. Defaults to FALSE.

Value

Stock-and-flow model of class xmile.

See also

Examples

sfm = insightmaker_to_sfm(URL =
 'https://insightmaker.com/insight/5LxQr0waZGgBcPJcNTC029/Crielaard-et-al-2022')
#> This model uses Insight Maker version 38, whereas the package was based on Insight Maker version 37. Some features may not be available.
plot(sfm)
sim = simulate(sfm) plot(sim)